package com.myschool.server.dao.impl;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.springframework.stereotype.Repository;

import com.myschool.server.dao.StudentsParentsLinkDao;
import com.myschool.server.dao.support.BaseEntityDaoHibernate;
import com.myschool.server.model.Grade;
import com.myschool.server.model.StudentsParentsLink;


@Repository
public class StudentsParentLinkDaoImpl  extends BaseEntityDaoHibernate<StudentsParentsLink> implements
StudentsParentsLinkDao {

	public StudentsParentLinkDaoImpl( ) {
		super(StudentsParentsLink.class);
		// TODO Auto-generated constructor stub
	}

	@Override
	public List<StudentsParentsLink> retrieveAllParentsBySection(Long sectionID) {
		// TODO Auto-generated method stub
		List<StudentsParentsLink> links =  getHibernateTemplate().find(
				" from StudentsParentsLink link join fetch link.student where link.student.section.entityId = ?", sectionID) ;
		
		return links;

	}

}
